package com.msh.artascope.web.common.bean;

import com.msh.artascope.interfaces.ILoginAccount;
import com.msh.artascope.web.common.config.ConfigLoginConfiguration;

public class ConfigLoginAccount implements ILoginAccount {
    private final ConfigLoginConfiguration.Account account;

    public ConfigLoginAccount(ConfigLoginConfiguration configuration) {
        ConfigLoginConfiguration.Account account = configuration.getAccount();
        if(null == account){
            account = new ConfigLoginConfiguration.Account();
            account.setId(1L);
            account.setAccount("sys_admin");
            account.setTenantId(1L);
        }
        this.account = account;
    }

    @Override
    public Long getId() {
        return account.getId();
    }
    @Override
    public String getAccount() {
        return account.getAccount();
    }
    @Override
    public Long getTenantId() {
        return account.getTenantId();
    }
}
